#!/usr/bin/python
from lex import *
from leer_config import *

class Singleton(type):

	def __init__(cls, name, bases, dct):
		cls.__instance = None
		type.__init__(cls, name, bases, dct)

	def __call__(cls, *args, **kw):
		if cls.__instance is None:
			cls.__instance = type.__call__(cls, *args,**kw)
		return cls.__instance

class StopList:
	__metaclass__ = Singleton
	def __init__(self):
		cargarAnalizador(open(leer_resources()+"StopList.txt","r").read())
		self.lista = obtenerPalabras()

	def getLista(self):
		return self.lista

	def estaEn(self,palabra):
		return palabra in self.lista



